import request from "@/utils/request";

//获取所有项目
export function getProjects() {
  return request({ url: "/api/project", method: "GET" });
}

//修改项目
export function editProject(projectInfo) {
  return request({
    url: `/api/project/${projectInfo.id}`,
    method: "PUT",
    data: projectInfo.data,
  });
}

//新增项目
export function addProject(data) {
  return request({ url: `/api/project`, method: "POST", data });
}

//删除项目
export function delProject(id) {
  return request({ url: `/api/project/${id}`, method: "DELETE" });
}
